package it.antonio.ilpizze.te;

import java.util.NoSuchElementException;


public class Tokens {
	private Token current;
	private Token first;
	
	public void add(Token token){
		if(current == null){
			current = token;
			first = token;
		} else {
			current.next = token;
			current = current.next;
		}
	}
	
	public boolean isEmpty(){
		return first == null;
	}
	
	public Token first(){
		if(first == null) throw new NoSuchElementException();
		return first;
	}
	
	
}
